<table class="table">
  <thead>
    <tr>
      <th class="first"><%= "#{t 'helpers.label.accessory.product'}" %></th>
      <th><%= "#{t 'helpers.label.accessory.variant'}" %></th>
      <th class="last"></th>
    </tr>
  </thead>
  <tbody>
    <% unless accessories.blank? %>
      <%= accessories.each do |accessory| %>
        <%# PRODUCT %>
        <% if accessory.is_master?  %>
          <th><%= accessory.product.presentation %></th>
          <td>Celý výrobek</td>
          <td>
            <% permitted_to? :delete, :admin_product_accessories do %>
              X
            <% end %>
          </td>
        <%# VARIANT %>
        <% else %>
    
        <% end %>
      <% end %>
    <% else %>
    <% end %>
  </tbody>
</table>

<script type="text/javascript">
  jQuery(function() {
    var toggleSpinner = function() {$("#spinner").toggle()};

    $(".variant")
      .bind("ajax:beforeSend", toggleSpinner)
      .bind("ajax:complete", toggleSpinner);
  });
</script>